Metrics explorer page design - #3348
benjaminleonard wants to merge 24 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| * | ||
| * Exported for tests; use {@link oxqlAutocomplete} in the editor. | ||
| */ | ||
| export const oxqlCompletionSource = |
…query scope, datum
No point leaving it behind.
They're stable.
There is no such thing as "one representative query". There are three distinct kinds of charts, to say nothing of layout!
Codemirror was putting it behind the active line, making it challenging to see what text you selected (and impossible to tell what whitespace you selected).
This page is already tipped pretty far into "knowing everything about backend implementation details", so I'm just grabbing an easy win here.
Safari has subpixel precision on bounding boxes, so we need slightly more tolerance than exact matching for cursor<->placeholder comparisons. "Within a pixel" seems fair enough to me.
Not sure it needs its own doc link, but the docs do give a _little_ context.
| return /[",\n]/.test(s) ? `"${s.replaceAll('"', '""')}"` : s | ||
| } | ||
|
|
||
| const tablesToCsv = (tables: OxqlTable[]): string => { |
There was a problem hiding this comment.
I think CSVs aren't worth the effort. The fields data, which is arguably the most important, is pretty useless as a single column; any reasonable CSV would have an independent column for each field instead of concatenating them together. But that isn't always doable in our case, because queries may hit multiple tables and so have different fields across all data. The answer to that is to include a column for each field of each table, and leave the values empty when your row doesn't belong to that table. And given that two tables may share a field name but not a field meaning, those names should be in some form like Field (Table Name). All of which we could do, but I say it all mostly to illustrate that the JSON is much more pliable to an end-user, and it'll be tough for us to form a CSV with much utility without knowing someone's use case for it (as opposed to them generating it from the JSON themselves)
WIP